#ifndef MATRIX_H_
#define MATRIX_H_
#include <iostream>


	class Matrix
	{
	  double *array;
	  int column, row;
	  
	  void swap(double&, double&);
	  int max(const int);

	public:
		Matrix() : column(0), row(0){array = 0;}
		Matrix(const Matrix&);
		Matrix(const int& r, const int& c) : column(c), row(r){array = new double[row*column];}

		virtual ~Matrix(){if(array) delete[] array;}
		  	
		void setNumCol(const int& col){column = col;}
		void setNumRow(const int& nrow){row = nrow;}
		int getNumCol() const{return column;}
		int getNumRow() const{return row;}
		void setpArray(double* pMatrix){array = pMatrix;}
		double *getpArray() const{return array;}
		int getSize()const{return column*row;}
		
		Matrix& operator=(const Matrix&);
		Matrix& operator+=(const Matrix&);
		Matrix& operator-=(const Matrix&);
		Matrix& operator*=(const Matrix&);
		void add(const double*);
		void inverse();
		Matrix  transpose();
	};
	
	Matrix operator+(const Matrix&, const Matrix&);
	Matrix operator-(const Matrix&, const Matrix&);
	Matrix operator*(const Matrix&, const Matrix&);
	std::ostream& operator << (std::ostream&, const Matrix&);

#endif /* MATRIX_H_ */
